package javatest3.ForWhileTest.test6;

import java.util.Scanner;

public class method3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
       int sum=0;
        int num = scanner.nextInt();
        for (num=num;num>9;num=num/10){
            sum=sum+num%10;
        }
        System.out.println(sum);
    }

}
